package com.fulu.realtime.utils;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Author lizhenchao@atguigu.cn
 * @Date 2021/10/30 11:20
 */
public class ThreadPoolUtil {
    public static ThreadPoolExecutor getThreadPool() {
        return new ThreadPoolExecutor(
            300, // 线程池内核心线程数
            500, // 线程池内最大线程数
            30, // 空闲线程存活时间
            TimeUnit.SECONDS,
            new LinkedBlockingDeque<>(50)
        );
    }
}
